/*
 * Filename    : Sound_Load.java
 * Projectname : RamaShinta
 * Date        : Nov 18, 2012 , 7:50:59 PM 
 * 
 * Class for Load Sound our Games
 * 
 * Super Class for sound Package
 */

package com.amikomgamedev.ramashinta.sound;

import org.andengine.audio.music.Music;
import org.andengine.audio.music.MusicFactory;
import org.andengine.audio.music.MusicManager;
import org.andengine.audio.sound.Sound;
import org.andengine.audio.sound.SoundFactory;
import org.andengine.audio.sound.SoundManager;
import org.andengine.ui.activity.BaseGameActivity;

import android.content.Context;

public class Sound_Load implements Sound_Path
{
	protected BaseGameActivity	activity;

	protected Music				bgm_Game;
	protected Music				bgm_Menu;
	protected Sound				snd_Punch;
	protected Sound				snd_Patah;
	protected Sound				snd_Choco;
	protected Sound				snd_Racun;
	protected Sound				snd_Panah_Api;
	protected Sound				snd_Panah;
	

	public Sound_Load(Context con)
	{
		activity = (BaseGameActivity) con;
	}

	private MusicManager getMusicManager()
	{
		return activity.getMusicManager();
	}

	private SoundManager getSoundManager()
	{
		return activity.getSoundManager();
	}

	public void loadGameplayBgm()
	{
		try
		{
			bgm_Game = MusicFactory.createMusicFromAsset(getMusicManager(), activity, GAMEPLAY_BGM);
			bgm_Game.setLooping(true);
		} catch (Exception e)
		{
			// TODO: handle exception
		}
	}

	public void loadMenuBgm()
	{
		try
		{
			bgm_Menu = MusicFactory.createMusicFromAsset(getMusicManager(), activity, MENU_BGM);
			bgm_Menu.setLooping(true);
		} catch (Exception e)
		{
			// TODO: handle exception
		}
	}

	public void loadSoundGameplay()
	{
		try
		{
			snd_Punch = SoundFactory.createSoundFromAsset(getSoundManager(), activity, GAMEPLAY_HIT);
			snd_Patah = SoundFactory.createSoundFromAsset(getSoundManager(), activity, MENU_KLIK);
			snd_Choco = SoundFactory.createSoundFromAsset(getSoundManager(), activity, GAMEPLAY_GET_CHOCO);
			snd_Racun = SoundFactory.createSoundFromAsset(getSoundManager(), activity, GAMEPLAY_GET_RACUN);
			snd_Panah_Api = SoundFactory.createSoundFromAsset(getSoundManager(), activity, GAMEPLAY_PANAH_API);
			snd_Panah = SoundFactory.createSoundFromAsset(getSoundManager(), activity, GAMEPLAY_PANAH);

		} catch (Exception e)
		{
			// TODO: handle exception
		}
	}
	
	
}
